<?php

namespace App\Trip\Orders\BookOrders\Params\Plane;

use App\Trip\Orders\BookOrders\Params\AbstractParam\TripParam;
use App\Trip\Orders\BookOrders\Plane\BuildChangeOrderData;
use App\Trip\Orders\BookOrders\Plane\BuildOrderData;
use App\Trip\Plane\PlaneInfo\FlightInfo;
use Exception;

class PlaneParam extends TripParam
{
    private BuildOrderData|BuildChangeOrderData $bookingTagValue;

    public function __construct(array $params)
    {
        $this->bookingTagValue = $params['bookingTagValue'];
    }

    /**
     * @throws Exception
     */
    public function toArray(): array
    {
        return $this->getTripInfo()->getFlightInfo();
    }

    /**
     * @throws Exception
     */
    public function getTripInfo(): FlightInfo
    {
        return $this->bookingTagValue->getFlightInfo();
    }

    /**
     * @return string
     */
    function getStartAt(): string
    {
        return $this->getTripInfo()->getDepartAt();
    }

    /**
     * @return string
     */
    function getArriveAt(): string
    {
        return $this->getTripInfo()->getArriveAt();
    }

    /**
     * @return string
     */
    function getTripCode(): string
    {
        return $this->getTripInfo()->getFlightNo();
    }

    /**
     * @return string
     */
    function getFromCode(): string
    {
        return $this->getTripInfo()->getFromCode();
    }

    /**
     * @return string
     */
    function getToCode(): string
    {
        return $this->getTripInfo()->getToCode();
    }

    /**
     * @return string
     */
    function getFromName(): string
    {
        return '';
    }

    /**
     * @return string
     */
    function getToName(): string
    {
        return '';
    }

    /**
     * @return string
     */
    function getFromNameUy(): string
    {
        return '';
    }

    /**
     * @return string
     */
    function getToNameUy(): string
    {
        return '';
    }

    /**
     * @return mixed
     */
    function getFrom()
    {
        return null;
    }

    /**
     * @return mixed
     */
    function getTo()
    {
        return null;
    }
}